Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.flatmap

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.flatmap

The lodash method `_.flatMap` exported as a module.

  • 4.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
322K
increased by8.44%
Maintainers
3
Weekly downloads
 
Created

What is lodash.flatmap?

The lodash.flatmap package is a utility library that provides a method to map and flatten a collection in a single operation. It is part of the Lodash library, which is a popular JavaScript utility library that offers a wide range of functions for common programming tasks.

What are lodash.flatmap's main functionalities?

Map and Flatten

This feature allows you to map each element in a collection to a new value and then flatten the result into a single array. In this example, we map each user to their pets and then flatten the resulting arrays into a single array of pet names.

const _ = require('lodash.flatmap');
const users = [
  { 'user': 'barney', 'age': 36, 'pets': ['hoppy'] },
  { 'user': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
];
const result = _.flatMap(users, function(o) { return o.pets; });
console.log(result); // ['hoppy', 'baby puss', 'dino']

Other packages similar to lodash.flatmap

Keywords

FAQs

Package last updated on 13 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc